# _*_ coding: UTF-8 _*_
# @Time     : 2021/11/3 15:12
# @Author   : 郑鲁明
# @Site     : http://www.hzdledu.cn/
# @File     : case.py
# @Software : PyCharm

import unittest
from selenium import webdriver
from web_d5_pom.page.loging_page import LoginPage
from web_d5_pom.page.main_page import MainPage
from web_d5_pom.page.change_personnel_list import ChangePersonnelList

class ChangePersonnerList(unittest.TestCase):

    def setUp(self) -> None:
        self.driver = webdriver.Chrome()
        self.login_page = LoginPage(self.driver)
        self.mainpage = MainPage(self.driver)
        self.changpersonnerlist = ChangePersonnelList(self.driver)

    def test1(self):
        # 登录
        self.driver.get('http://192.168.6.113/cloud/#/open/login')
        self.driver.maximize_window()
        self.login_page.input_user('admin')
        self.login_page.input_password('123456')
        self.login_page.input_vcode('8888')
        self.login_page.click_login()

        self.changpersonnerlist.jump_to() #切换至变更人事专员列表
        self.changpersonnerlist.query_open() # 打开查询界面
        self.changpersonnerlist.query_close() # 查询界面右上角关闭按钮

        # 退出登录
        self.mainpage.move_to_icon()
        self.mainpage.click_logout()


    def tearDown(self) -> None:
        self.driver.quit()

if __name__ == '__main__':
    test1 = ChangePersonnerList()
    test1.setUp()
    test1.test1()
    test1.tearDown()